home *** CD-ROM | disk | FTP | other *** search
- Path: news.production.compuserve.com!news
- From: Steve Eckmann <71055.1153@CompuServe.COM>
- Newsgroups: comp.lang.c
- Subject: truncation function?
- Date: 11 Feb 1996 00:07:48 GMT
- Organization: CompuServe, Inc. (1-800-689-0736)
- Message-ID: <4fjc0k$nev$1@mhadg.production.compuserve.com>
-
- I need a truncation function "float trunc(float in; int
- precision)" that
- takes a float and a precision spec and returns the input float
- truncated to
- "precision" decimal digits. Similarly for "round". This seems so
- simple
- that I hesitate to ask, but on the other hand, my attempt (using
- sprintf
- and sscanf) yields incorrect results sometimes. Thanks.
-
- -Steve
-